package com.sskj.mine.ui.activity;

import android.os.Bundle;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.sskj.common.rxbus2.RxBus;
import com.sskj.common.util.ClickUtil;
import com.sskj.lib.RConfig;
import com.sskj.lib.RxBusCode;
import com.sskj.lib.base.BaseActivity;
import com.sskj.lib.util.APKVersionCodeUtils;
import com.sskj.mine.R;
import com.sskj.mine.R2;
import com.sskj.mine.presenter.MineSettingPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;

@Route(path = RConfig.MINE_SETTING)//设置
public class MineSettingActivity extends BaseActivity<MineSettingPresenter> {


    @BindView(R2.id.rl_update)
    RelativeLayout rlUpdate;
    @BindView(R2.id.bottom_version)
    TextView bottomVersion;
    private String versionName;

    @Override
    protected int getLayoutResId() {
        return R.layout.mine_setting_activity;
    }

    @Override
    public MineSettingPresenter getPresenter() {
        return new MineSettingPresenter();
    }

    @Override
    public boolean getImmersion() {
        return false;
    }

    @Override
    protected void initView() {
        super.initView();
        setTitle("设置");
        versionName = APKVersionCodeUtils.getVerName(this);
        bottomVersion.setText("当前版本  " + versionName);
        ClickUtil.click(rlUpdate, () -> {
            RxBus.getDefault().send(RxBusCode.VERSION_UPDATE);
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
